import { defineStore } from 'pinia'
import { ref } from 'vue'
/**
 * @Author: 段晓龙
 * @Date: 2024-09-29 10:20:16
 * @Description: 页面信息存储
 * @LastEditors: 段晓龙
 */
export const usePageInfoStore = defineStore(
  'cnac-pageinfo',
  () => {
    // 云网安全个人积分页面详情参数
    const cloudInfo = ref<any>({})
    const setCloudInfo = (data: any) => {
      cloudInfo.value = data
    }
    // 画像详情参数
    const huaxiangInfo = ref<any>({})
    const setHuaxiangInfo = (data: any) => {
      huaxiangInfo.value = data
    }
    // 清除存储的所有页面信息
    const clearCloudInfo = () => {
      cloudInfo.value = {}
    }
    return {
      cloudInfo,
      setCloudInfo,
      huaxiangInfo,
      setHuaxiangInfo,
      clearCloudInfo
    }
  },
  {
    persist: true // 开启持久化
  }
)
